#include<iostream>
#include<map>
using namespace std;

/*
    map.erase 删除键值对
    map.erase(key) 依据键，删除指定键值对
    map.erase(iterator) 依据迭代器，删除指定键值对

*/

int main()
{
    map<string, string> map1;

    map1.insert(pair<string, string>("张三", "2528班级"));
    map1.insert(make_pair("李四", "2530班级"));
    map1.insert(pair<string, string>("王五", "2528班级"));

    // map1.erase("李四");
    // map1.erase(map1.begin());

    auto ret = map1.find("王五");
    map1.erase(ret);
    

    for(auto it : map1)
    {
        cout << it.first << " " << it.second << endl;
    }


    
    
    return 0;
}